#!/bin/bash

##   test  连续插入 ####

mysql -uroot -p123456a? -hk8s3 -P31586 test -e " \
Create Database If Not Exists test ;
create table If Not Exists test(name varchar(32),  age int , createTime datetime ); \
delete from test ;"

i=1;
MAX_INSERT_ROW_COUNT=$1;
while [ $i -le $MAX_INSERT_ROW_COUNT ]
do
    mysql -uroot -p123456a? -hk8s3 -P31586 test -e "insert into test (name,age,createTime) values ('HELLO$i',$i % 99,NOW());"
    d=$(date +%M-%d\ %H\:%m\:%S)
    echo "INSERT HELLO $i @@ $d"
    i=$(($i+1))
    sleep 0.05
done

